<?
// placeholder - eventually will insert into links table, for now just displaying to confirm JSON POST worked.

include_once('db_setup.php');
$lat = $_REQUEST['lat'];
$lon = $_REQUEST['lon'];
$city = $_REQUEST['city'];
$state = $_REQUEST['state'];
$county = $_REQUEST['county'];

$linkURI = $_REQUEST['linkURI'];
$homepage = $_REQUEST['homepage'];

//$homepage = $_REQUEST['homepage'];
echo '<table>';
echo "<tr><td>lat</td><td>$lat</td></tr>";
echo "<tr><td>lon</td><td>$lon</td></tr>";
echo "<tr><td>city</td><td>$city</td></tr>";
echo "<tr><td>county</td><td>$county</td></tr>";
echo "<tr><td>state</td><td>$state</td></tr>";
echo "<tr><td>link</td><td>$linkURI</td></tr>";
echo "<td>homepage</td><td>$homepage</td>";
echo '</table>';

die();

$query = "SELECT * from $table where id=$recordID";
$result = mysql_query($query); 
$rows = 0;
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
//	$temp = json_decode($row['json'], true);
//	array_push($row,$temp);
	$output[] = $row;
//	$output[] = $temp;
	$rows = $rows + 1;
}
$data = json_encode($output);  //encode the data in json format
echo '({"total":"' . $rows . '","results":' . $data . '})';
?>
